home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / Source / GNU / cctools / include / architecture / m88k / reg_help.h < prev   
Encoding:
C/C++ Source or Header  |  1993-06-29  |  1.4 KB  |  60 lines

  1. /* Copyright (c) 1991 NeXT Computer, Inc.  All rights reserved.
  2.  *
  3.  *    File:    architecture/m88k/reg_help.h
  4.  *    Author:    Mike DeMoney, NeXT Computer, Inc.
  5.  *
  6.  *    This header file defines cpp macros useful for defining
  7.  *    machine register and doing machine-level operations.
  8.  *
  9.  * HISTORY
  10.  * 23-Jan-91  Mike DeMoney (mike@next.com)
  11.  *    Created.
  12.  */
  13.  
  14. #ifndef _ARCH_M88K_REG_HELP_H_
  15. #define _ARCH_M88K_REG_HELP_H_
  16.  
  17. #import <architecture/nrw/reg_help.h>
  18.  
  19. /* Stack pointer must always be a multiple of 16 */
  20. #define    STACK_INCR    16
  21. #define    ROUND_FRAME(x)    ((((unsigned)(x)) + STACK_INCR - 1) & ~(STACK_INCR-1))
  22.  
  23. /*
  24.  * REG_PAIR_DEF -- define a register pair
  25.  * Register pairs are appropriately aligned to allow access via
  26.  * ld.d and st.d.
  27.  *
  28.  * Usage:
  29.  *    struct foo {
  30.  *        REG_PAIR_DEF(
  31.  *            bar_t *,    barp,
  32.  *            afu_t,        afu
  33.  *        );
  34.  *    };
  35.  *
  36.  * Access to individual entries of the pair is via the REG_PAIR
  37.  * macro (below).
  38.  */
  39. #define    REG_PAIR_DEF(type0, name0, type1, name1)        \
  40.     struct {                        \
  41.         type0    name0 __attribute__(( aligned(8) ));    \
  42.         type1    name1;                    \
  43.     } name0##_##name1
  44.  
  45. /*
  46.  * REG_PAIR -- Macro to define names for accessing individual registers
  47.  * of register pairs.
  48.  *
  49.  * Usage:
  50.  *    arg0 is first element of pair
  51.  *    arg1 is second element of pair
  52.  *    arg2 is desired element of pair
  53.  * eg:
  54.  *    #define    foo_barp    REG_PAIR(barp, afu, afu)
  55.  */
  56. #define    REG_PAIR(name0, name1, the_name)            \
  57.     name0##_##name1.the_name
  58.  
  59. #endif  _ARCH_M88K_REG_HELP_H_
  60.